package com.quick.threadtest;

public class Singleton {
    private static Singleton singleton;

    private Singleton(){}

    public static Singleton getSingleton(){
        if (singleton==null){
            synchronized (Singleton.class){
                if (singleton==null){
                    singleton = new Singleton();
                }
            }
        }
        return singleton;
    }

    public void hello(){
        System.out.println("hello world!!");
    }
}
